RSpec
In the steps below, we'll start with a Ruby project that has an existing RSpec test suite, and we'll add JUnit XML as an additional output format for the test suite. In each step, we'll show the Git diff for the change that we're making.
Add
rspec_junit_formatteras a dependency.bundle add rspec_junit_formatterVerify that your Gemfile file includes the new dependency:
source 'https://rubygems.org'
ruby '2.6.6'
gem 'rspec'
+gem 'rspec_junit_formatter'Update your
.rspecconfiguration file to output JUnit XML reports atspec/reports/rspec.xml.--require spec_helper
--format progress
+--format RspecJunitFormatter
+--out spec/reports/rspec.xmlUpdate your
.gitignorefile so that the JUnit report doesn't accidentally get checked into the repository./.bundle
+/spec/reportsCommit these changes to your repository.
git commit -am "Generate test reports with rspec_junit_formatter"The final result of these changes should resemble commit 4c1403c in the buildpulse-example-rspec repository.